<?php
InitGP(array("status",'action','gid','status', 'page')); //初始化变量全局返回
include_once(INC_PATH."/goodsforecast.class.php");
$g = new GoodsForecastClass();
$uid = $_USERS['uid'];
if($action == 'del'){
        //判断是否是有权利
        $good = $g->getone($gid);
        if($good['uid'] != $uid){
                showmsg('你没有权利修改', -1);
        }
        if($good['status'] != 1){
                showmsg('当前状态不能删除', -1);
        }
        $rs = $g->giddel($gid);
        if($rs == 'OK'){
                showmsg('当前订单已经删除', -1);
        }
        exit;
}else if($action == 'edit'){
        $good = $g->getone($gid);
        if($good && ($good['uid'] == $uid)){
                if($good['status'] == 3){
                        include template('member_depotlist_pay');//包含输出指定模板
                }
        }else{
                showmsg('没有权利修改', $gourl);
        }
}else{
        $pagesize = 20;                                                                                              //一页显示信息数
        $page = isset($page) ? max(1, intval($page)) : 1;             //处理页码变量
        $offset=($page-1)*$pagesize;
        $where = ' O.uid = '.$uid;
        if($status){
                $where .= ' AND O.status = '.$status;
        }		
		$total = $g->getuserdatacount($where);
        $exlist = $g->getuserdata("$offset,$pagesize", $where, 'status');
        foreach($exlist as $key=>$ex){
                $exlist[$key]['status_info'] = $g->getStatusInfo($ex['status']);
        }
        include template('member_depotlist');//包含输出指定模板
}
?>